/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package it.tukano.swingdeco.containers;

import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.JPanel;
import javax.swing.JToolBar;

/**
 * A panel that displayes a component and a set of buttons
 * @author utente3
 */
public class ToolbarPanel extends JPanel {

    /* default serial version code */
    private static final long serialVersionUID  = 0;

    private JToolBar buttons = new JToolBar();

    public ToolbarPanel(String borderLayoutButtonsPosition) {
        super(new BorderLayout());
        buttons.setFloatable(false);
        buttons.setOrientation(JToolBar.HORIZONTAL);
        add(buttons, borderLayoutButtonsPosition);
    }

    public ToolbarPanel addButton(Component c) {
        buttons.add(c);
        return this;
    }

    public ToolbarPanel setComponent(Component component) {
        add(component, BorderLayout.CENTER);
        return this;
    }
}
